
#include <stdio.h>
#include <esp_timer.h>
#include <unistd.h>
#include "encoder.h"
#include "serial.h"
#include "nvs.h"
#include "nvs_flash.h"
#include "freertos/FreeRTOS.h"
#include "freertos/task.h"
#include "esp_task_wdt.h"
#include "sdkconfig.h"
#include "lwip/err.h"
#include "lwip/sockets.h"
#include "wifi.h"
#include "axis_monitor.h"

void app_main() 
{   
    esp_err_t ret = nvs_flash_init();
    if (ret == ESP_ERR_NVS_NO_FREE_PAGES || ret == ESP_ERR_NVS_NEW_VERSION_FOUND)
    {
        if( ( ret = nvs_flash_erase() ) == ESP_OK )
            ret = nvs_flash_init();
    }
    init_uart();
    init_wifi_sta();
    axis_monitor(X_AXIS,GPIO_NUM_16,GPIO_NUM_17,GPIO_NUM_18,GPIO_NUM_19);
    //axis_monitor(Y_AXIS,GPIO_NUM_25,GPIO_NUM_26,GPIO_NUM_27,GPIO_NUM_14);
}